<?php
include APPPATH."views/frontend/inc/01_meta.php";
include APPPATH."views/frontend/inc/02_head.php";
include APPPATH."views/frontend/inc/04_slider.php";
?>

<div class="navi">
	<a href="/home">Trang chủ</a>
	<span>/</span>
	<span class="active">Tin tức</span>
	<div class="clear"></div>
	<?php include APPPATH."views/frontend/inc/05_social.php"; ?>
</div>
<div class="container">
	<div class="-row" >
		<div class="col-sm-6">
			<?php foreach($news_list as $$news_detail)
			<div class="cake-news">
				<h3><?php echo $news_detail->Title?></h3>
				<div >
					<?php echo $news_detail->Desc?>
				</div>
				<div>
					<a href="/tin-tuc/<?php echo $news_detail->Id ?>-<?php echo $news_detail->Alias?>" class="btn btn-default">XEM THÊM</a>
				</div>
			</div>
		</div>
		<div class="col-sm-6">
			<div class="cake-news">
				<h3>SẢN PHẨM MỚI</h3>
				<div class="cake-text">
					Sản phẩm nổi bật được đặt hàng nhiều
				</div>
			</div>
			<div class="row-" style="margin-left:-4px;margin-right:-4px;">
			<?php 
				foreach($products as $cake){ 
					$thumb = $cake->product_thumb;
					$thumb = preg_replace('/\/data/','',$thumb,1);
					if(file_exists(APPPATH. "../data/thumbs/$thumb") && is_file(APPPATH. "../data/thumbs/$thumb")){
						$cake->small_thumb = "/data/thumbs$thumb";
					}else{
					$cake->small_thumb = $cake->product_thumb;
					}
			?>
				<div class="col-md-6 col-sm-12 col-sxs-6 col-xs-12">
					<div class="cake-item flip-container row" style="padding:4px">
						<a class="swipebox" 
							title="<?php echo $cake->product_title?>" 
							href="<?php echo $cake->product_thumb?>">
							<div class="nailthumb" data-rel="imageGallery">
								<div class="nailthumb-figure"
									data-title="<?php echo $cake->product_title?>" 
									data-src="<?php echo $cake->product_thumb?>"
									>
									<div class="nailthumb-container">
										<div class="front">
											<img class="flu lazy" data-original="<?php echo $cake->small_thumb?>"
												alt="<?php echo $cake->product_title?>"
												title="<?php echo $cake->Title?>"
												/>
										</div>
										<div class="back">
											<img class="flu wp-image-55 lazy" data-original="<?php echo $cake->small_thumb?>"
												alt="<?php echo $cake->product_title?>"
												title="<?php echo $cake->product_title?>"
												/>
										</div>
									</div>
									<?php if(!empty($cake->product_price_vi)){ ?>
									<div class="nailthumb-mark">
										<div class="cake-price"><?php echo $cake->product_price_vi;?></div>
									</div>
									<?php } ?>
								</div>
							</div>
						</a>
						<div>
							<div class="cake-title"><?php echo $cake->product_title?></div>
						</div>
					</div>
				</div>
			<?php } ?>
			</div>
			<div style="padding:15px 0">
				<a href="/san-pham" class="btn btn-default">XEM THÊM</a>
			</div>
		</div>
		<div class="clear"></div>
	</div>
</div>
<?php
include APPPATH."views/frontend/inc/03_foot.php";
?>